package cn.itcast.bos.service.base.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.StandardRepository;
import cn.itcast.bos.domain.base.Standard;
import cn.itcast.bos.service.base.StandardService;
@Service
@Transactional
public class StandardServiceImpl implements StandardService {
   @Resource(name="standardRepository")
     private StandardRepository standardRepository;

     
	@Override
	public void save(Standard standard) {
		System.out.println(standard.getName()+standard.getMaxLength()+standard.getMaxWeight());
		standardRepository.save(standard);
	}


	@Override
	public Page<Standard> pageQuery(PageRequest pageRequest) {
		
		return standardRepository.findAll(pageRequest);
	}


	@Override
	public List<Standard> findAll() {
		// TODO Auto-generated method stub
		return standardRepository.findAll();
	}
     
}
